import { getAreaAPI } from '@/services/address'
import type { AddressAll } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAddressStore = defineStore('address', () => {
  const selectedAddress = ref<AddressAll[]>([])

  const getArea = async () => {
    const res = await getAreaAPI()
    selectedAddress.value = res.data
  }
  return {
    selectedAddress,

    getArea,
  }
})
